# # 规则
# print("0代表石头,1代表剪刀,2代表布")
# # 用户先输入
# user = input("请您先输入:")
#
# # 判断用户输入的是否合法
# # if user == "1" or user == "0" or user == "2":
# if user in ["1", "2", "0"]:
#     user = int(user)
#     # 电脑随机输入
#     import random
#
#     comp = random.randint(0, 2)
#     print(f"电脑输入的是:{comp}")
#     # 方式一:
#     # # 如果用户输入的是石头, 电脑输入的是剪刀, 用户赢
#     # if user == 0 and comp == 1:
#     #     print("用户赢")
#     # # 如果用户输入的是剪刀, 电脑输入的是布, 用户赢
#     # elif user == 1 and comp == 2:
#     #     print("用户赢")
#     # # 如果用户输入的是布, 电脑输入的是石头, 用户赢
#     # elif user == 2 and comp == 0:
#     #     print("用户赢")
#     # 方式二: 用户赢的情况写到了一起
#     if (user == 0 and comp == 1) or (user == 1 and comp == 2) or (user == 2 and comp == 0):
#         print("用户赢")
#     # 如果用户输入的和电脑一致: 平局
#     elif user == comp:
#         print("平局")
#     # 其他情况: 电脑赢
#     else:
#         print("电脑赢")
# else:
#     print("输入非法")

# ====================================================


# # 循环变量
# line = 1
# # 循环判断
# while line <= 5:
#     # 循环体
#     # ==================================
#     # 打印正方形
#     # 循环变量
#     n = 1
#     # 循环判断
#     while n <= 5:
#         # 循环体
#         print("*", end="")
#         # 循环变量发生变化
#         n += 1
#     print()
#     # ==================================
#     # 循环变量发生变化
#     line += 1


# for line in "bbbbb":
#     # 循环体:
#     # for循环实现
#     for i in "aaaaa":
#         print("*", end="")
#     print()


# # 循环变量
# line = 1
# # 循环判断
# while line <= 5:
#     # 循环体
#     # ==================================
#     # 循环变量
#     n = 1
#     # 循环判断
#     while n <= line:
#         # 循环体
#         print("*", end="")
#         # 循环变量发生变化
#         n += 1
#     print()
#     # ==================================
#     # 循环变量发生变化
#     line += 1


# # 循环变量
# line = 1
# # 循环判断
# while line <= 9:
#     # 循环体
#     # ==================================
#     # 打印正方形
#     # 循环变量
#     n = 1
#     # 循环判断
#     while n <= line:
#         # 循环体
#         print(f"{n}×{line}={n*line}", end="\t")
#         # 循环变量发生变化
#         n += 1
#     print()
#     # ==================================
#     # 循环变量发生变化
#     line += 1


# # 循环变量
# line = 1
# # 循环判断
# while line <= 9:
#     # 循环体
#     # ==================================
#     # 打印9-line个空格
#     # 循环变量
#     n = 1
#     # 循环判断
#     while n <= 9 - line:
#         # 循环体
#         print("-", end="")
#         # 循环变量发生变化
#         n += 1
#     # 打印line个星星
#     # 循环变量
#     n1 = 1
#     # 循环判断
#     while n1 <= line:
#         # 循环体
#         print("*", end="")
#         # 循环变量发生变化
#         n1 += 1
#     print()
#     # 换行
#     # ==================================
#     # 循环变量发生变化
#     line += 1


# 循环变量
line = 1
# 循环判断
while line <= 9:
    # 循环体
    # ==================================
    # 打印9-line个空格
    # 循环变量
    n = 1
    # 循环判断
    while n <= 9 - line:
        # 循环体
        print(" ", end="")
        # 循环变量发生变化
        n += 1
    # 打印line个星星
    # 循环变量
    n1 = 1
    # 循环判断
    while n1 <= line * 2 - 1:
        # 循环体
        print("*", end="")
        # 循环变量发生变化
        n1 += 1
    print()
    # 换行
    # ==================================
    # 循环变量发生变化
    line += 1
